<template>
	<el-drawer v-model="isShowDrawer" direction="rtl" :before-close="handleClose" :size="curDrawerSize" :close-on-click-modal="isReadOnly">
		<template #header="{ titleId, titleClass }">
			<div class="zs-drawer-header" :id="titleId" :class="titleClass">
				<i class="icon-b-item zs-icon zs-text-blue zs-space-right-sm"></i>
				<div class="zs-title zs-text-black">项目分析-北京朝阳合生汇</div>
			</div>
		</template>

		<template #default>
			<el-container class="zs-drawer-container">
				<el-scrollbar class="zs-drawer-content"> </el-scrollbar>
			</el-container>
		</template>

		<template v-if="handleType != 'info'" #footer>
			<el-button class="zs-btn-md zs-btn-primary" @click="doConfirm">提交</el-button>
		</template>
	</el-drawer>
</template>

<script setup>
	import { ref, watch, nextTick } from 'vue';
	import { useStore } from 'vuex';
	const props = defineProps({
		isShow: { type: Boolean, default: false },
		isReadOnly: { type: Boolean, default: true },
		handleType: { type: String, default: '' },
		currentRow: { type: Object },
	});

	let store = useStore();
	const curDrawerSize = ref(store.state.uiDrawerSizeBig);

	const emit = defineEmits(['close']);

	let isShowDrawer = ref(props.isShow);

	watch(
		() => props.isShow,
		(newVal) => {
			isShowDrawer.value = newVal;
			nextTick(() => {
			});
		},
	);

	//提交
	const doConfirm = async () => {};

	//关闭抽屉
	const handleClose = done => {
		emit('close', { isShow: false });
		done();
	};
</script>
